package reflect;

import reflect.Person;
import reflect.annotations.AutoRunClass;
import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

import reflect.*;
public class ReflectDemo12
{
    public static void main(String[] args) throws Exception {
        Class c =  Class.forName("reflect.Person");
        Method m = c.getMethod("sayHi");

        boolean mark =  m.isAnnotationPresent(AutoRunMethod.class);
        if (mark) {
            AutoRunMethod arm =  m.getAnnotation(AutoRunMethod.class);
            System.out.println(arm.value());
        }

    }
}